import { _decorator, Component, find, Node, ProgressBar } from 'cc';
import { Player } from './Player';
const { ccclass, property } = _decorator;

@ccclass('AtkInterval')
export class AtkInterval extends Component {
    private player:Node = null
    start() {
        this.player = find('Canvas/MainLogic/Player')
    }

    update(deltaTime: number) {
        this.node.getComponent(ProgressBar).progress = this.player.getComponent(Player).atkInterval/300
        if(this.player.getComponent(Player).falling){
            this.node.destroy()
        }
    }
}


